﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using com.vs.DataAccess.DO;
using com.vs.General;
using com.vs.General.RF;

namespace com.vs.RF.Web.task
{
    public partial class TaskOptionsEntryHandling : RFHandlingPage
    {
        private string stTaskPref;

        protected void Page_Load(object sender, EventArgs e)
        {
            stSourcePage = "task/TaskOptions.aspx";
            stTargetPage = "task/TaskIDEntry.aspx";
            go();
        }

        protected override void parseRequest()
        {
            stTaskPref = Request["hdTaskPref"];
            if (StringManager.IsEmpty(stTaskPref)){
                stError = MessageManager.MSG_TSK_008; //未找到对应的任务选项
                return;
            }
        }

        protected override void procData()
        {
            TaskPreferenceDO tskPrefDO = null;

            try
            {
                tskPrefDO = TaskPreferenceDO.GetModelByPK(rfSess, stTaskPref);
                if (null == tskPrefDO)
                {
                    stError = MessageManager.MSG_TSK_008;//未找到对应的任务选项
                    return;
                }
                else
                {
                    Session[RFSupport.TASK_PREFERENCE_DO] = tskPrefDO;
                }
            }
            catch (Exception e)
            {
                ExceptionManager.LogException(rfSess, e);
                stError = e.Message;
            }
            
        }
    }
}
